﻿using System;
using System.Collections.Generic;
using System.Text;

using DDBuildTools.DataAccess.Components;
namespace DDBuildTools.DataAccess
{
    /// <summary>
    /// 数据库操作类
    /// </summary>
    public class DBHelp
    {
        /// <summary>
        /// 获得表
        /// </summary>
        /// <param name="ConnStr"></param>
        /// <param name="DBType"></param>
        /// <param name="DataBaseCode"></param>
        /// <returns></returns>
        public List<TableEntity> GetDataBaseTable(string ConnStr, string DBType,out string DataBaseCode)
        {
            IDataBaseFactory DataBaseFactory = (IDataBaseFactory)Activator.CreateInstance("DDBuildTools.DataAccess", string.Format("DDBuildTools.DataAccess.{0}", DBType)).Unwrap();
            IDataBase DataBase = DataBaseFactory.CreateDataBase();
            return DataBase.GetDataBaseTable(ConnStr,out DataBaseCode);
        }
    }
}
